package validation;

import java.util.*;
import card.Cardset;

/**
 * To store the card type within a list and identify together.
 * 
 */
public class TypeList implements Identifiable {

	private List<Identifiable> list = new ArrayList<Identifiable>();
	
	/**
	 * To add a new type into the ArrayList
	 * @param Identifiable The Type object
	 */
	public void add(Identifiable identifier){
		list.add(identifier);
	}
	
	@Override
	public Type identify(Cardset thisHand) {
		Type result = null;
		for (Identifiable type : list){
			result = type.identify(thisHand);
			if(result != null){
				return result;
			}
		}
		
		return null;
	}
	

	
}
